using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Pistol : Gun
{
    public override void Fire()
    {
        base.Fire();

        float random = Random.Range(-5f, 5f);
        float r = (GameMgr.Get<IPlayerManager>().Player.Towards + 90 + random) * Mathf.PI / 180;
        float x = Mathf.Cos(r);
        float y = Mathf.Sin(r);
        
        GameMgr.Get<IBulletManager>().InstantiateBullets("PistolBullet", transform.position, 
            Vector2.zero, new Vector2(x, y), 1, damage, 0, new List<BulletMotion> { new Straight(0, 0.5f, 30, 0, 30) });
    }
}
